<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script type="text/javascript">
			function Getrow(obj) {
				if (event.srcElement.tagName == "TD") {//获取标签名
					curRow = event.srcElement.parentElement;//获取当前操作对象的父级对象
					alert("这是第" + (curRow.rowIndex + 1) + "行");//rowIndex 属性返回某一行在表格的行集合中的位置（row index）。
				}
			}
		</script>

		<table border="1" width="100%" onclick=Getrow(this)>
			<tr>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
			</tr>
			<tr>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
			</tr>
			<tr>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
			</tr>
			<tr>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
			</tr>
			<tr>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
			</tr>
			<tr>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
				<td width="20%">　</td>
			</tr>
		</table>
	</body>

</html>